home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Web Server / PHP.EXE / pear / DB / tests / odbc / skipif.inc < prev   
Encoding:
Text File  |  2001-01-15  |  606 b   |  24 lines

  1. <?php
  2. // This script prints "skip" unless:
  3. // * the odbc extension is built-in or loadable, AND
  4. // * there is a database called "test" accessible
  5. //   with no username/password, AND
  6. // * we have create/drop privileges on the entire "test"
  7. //   database
  8. if (!extension_loaded("odbc")) {
  9.   $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
  10.   @dl("odbc$dlext");
  11. }
  12. if (!extension_loaded("odbc")) {
  13.     die("skip\n");
  14. }
  15. require "dsn.inc";
  16. if (!$nativedsn) {
  17.     die("skip\n");
  18. }
  19. $conn = @odbc_connect($nativedsn, $user, $pass);
  20. if (!is_resource($conn)) {
  21.     die("skip\n");
  22. }
  23. ?>
  24.